import { getLoginList } from '../../api/users'
import { setItem, getItem } from '../../utils/sessiton'
export default {
    namespaced: true,
    state: {
        list: getItem() || {}
    },
    mutations: {
        SET_LOGIN(state, data) {
            state.list = data
        }
    },
    actions: {
        async getLoginList({ commit }, from) {
            let { data } = await getLoginList({ loginName: from.username, loginKey: from.password });
            setItem(data)
            commit('SET_LOGIN', data)
        }
    },
    getters: {
    }
}